home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / linux-2.0.34 / java.txt < prev    next >
Encoding:
Text File  |  1996-05-12  |  3.3 KB  |  104 lines

  1.                Java(tm) Binary Kernel Support for Linux v1.01
  2.                ----------------------------------------------
  3.  
  4. Linux beats them ALL! While all other OS's are TALKING about direct
  5. support of Java Binaries in the OS, Linux is doing it!
  6.  
  7. You execute Java classes as you would any other executable, after a few
  8. small details:
  9.  
  10.     1) You MUST FIRST install the Java Developers Kit for Linux.
  11.        The Java on Linux HOWTO gives the details on getting and
  12.        installing this. This HOWTO can be found at:
  13.  
  14.         ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/Java-HOWTO
  15.  
  16.        If you install the JDK in a location other than the suggested
  17.        directory of /usr/local/java, then you will need to tell the
  18.        kernel where you put the Java interpreter.  
  19.            There are two ways to do this.
  20.            One, edit fs/binfmt_java.c file and make the needed change to 
  21.        the _PATH_JAVA definition at the top of that file.  
  22.            Two, as root, issue the command:
  23.      echo "/path/to/java/interpreter" > /proc/sys/kernel/java-interpreter
  24.        (Currently, this does not work if you're using a module for
  25.         Java support.)
  26.  
  27.     2) You must chmod the '*.class' files you wish to execute with
  28.        the execute bit. This is not normally (till now) done with
  29.        '.class' files.
  30.  
  31.     3) You must optionally export a CLASSPATH environment variable,
  32.        if you plan to use Java applications installed outside of
  33.        /usr/local/java/classes/*.
  34.  
  35.     4) Either compile your kernel with Java support builtin, or
  36.        as a loadable module. If a module, load it with insmod or
  37.        kerneld.
  38.  
  39. To test your new setup, enter in the following simple Java app, and name
  40. it "HelloWorld.java":
  41.  
  42.     class HelloWorld {
  43.         public static void main(String args[]) {
  44.             System.out.println("Hello World!");
  45.         }
  46.     }
  47.  
  48.  
  49. Now compile the application with:
  50.  
  51.     /usr/local/java/bin/javac HelloWorld.java
  52.  
  53. Set the executable permissions of the binary file, with:
  54.  
  55.     chmod 755 HelloWorld.class
  56.  
  57. And then execute it:
  58.  
  59.     ./HelloWorld.class
  60.  
  61.  
  62. Yes, it's JUST THAT EASY! ;-)
  63.  
  64. -----------------------------------------------------------------
  65.  
  66. Nope, I didn't forget about Java Applets! ;-)
  67.  
  68. While this may not be the best way to do this, it works!
  69.  
  70. Take any html file used with the Java appletviewer (like the
  71. demo/Blink/example1.html file), and:
  72.  
  73.     1) Insert a new first line of:
  74.  
  75.         <!--applet-->
  76.  
  77.        Make sure the '<' is the first character in the file. This
  78.        will be treated as a valid HTML comment outside of this
  79.        Java Applet support, so the modified file can still be used
  80.        with all known browsers.
  81.  
  82.     2) If you install the JDK in a location other than the suggested
  83.        directory of /usr/local/java, then you will need to tell the
  84.        kernel where you put the Java appletviewer.  
  85.            There are two ways to do this.
  86.            One, edit fs/binfmt_java.c file and make the needed change to 
  87.        the _PATH_APPLET definition at the top of that file.  
  88.            Two, as root, issue the command:
  89.     echo "/path/to/java/appletviewer" > /proc/sys/kernel/java-appletviewer
  90.        (Currently, this does not work if you're using a module for
  91.         Java support.)
  92.  
  93.     3) You must chmod the '*.html' files you wish to execute with
  94.        the execute bit. This is not normally (till now) done with
  95.        '.html' files.
  96.  
  97.     4) And then execute it.
  98.  
  99.  
  100. Brian A. Lantz
  101. brian@lantz.com
  102. (/proc/sys/kernel/java-* support by Mike Shaver (shaver@ingenia.com))
  103.  
  104.